<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="box">123</div>
    <button>remove</button>
    <script>
        var box = document.querySelector(".box");

        box.addEventListener("click", function () {
            console.log("listener");
        });

        box.addEventListener("click", function () {
            console.log("123456789");
        });

        box.addEventListener("click", foo)
        function foo() {
            console.log("wuhu");
        }

        var btn = document.querySelector("button");

        btn.onclick = function () {
            box.removeEventListener("click", foo);
        };

        //     box.removeEventListener("click", function () {
        //     console.log("123456789");
        // });

    </script>
</body>

</html>